<?php
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title><?php echo $template ?></title>
        <link rel="icon" href="/Project_bbs/img/icon.png" type="image/x-icon"/>
        <link rel="stylesheet" href="/Project_bbs/css/front.css">
    </head>
    <body>
        <div class="top-nav">
                <div class="wrap clear-float">
                    <div class="fl">
                        <div class="bbs fl">BBS FORUM</div>
                        <a class="hover fl" href="index.php">首页</a>
                        <div class="search fl">
                            <form>
                            <input type="text" name="keyword" class="keyword"  placeholder="搜索其实很简单">
                            <input type="submit" name="submit" class="submit" value=""> 
                            </form>
                        </div>
                    </div>
                    <div class="log fr">
                        <?php 
                        if(basename($_SERVER['SCRIPT_NAME'])=="register.php"||basename($_SERVER['SCRIPT_NAME'])=="login.php"){
                            $url=urlencode("$_SERVER[SCRIPT_NAME]");
                        }else{
                            $url=urlencode("$_SERVER[REQUEST_URI]");
                        }                       
                        if($memberid) {                         
                            $outurl="/Project_bbs/front/logout.php?url={$url}";
                            echo "<a href='#'>您好！{$_COOKIE['member']['name']}</a>";
                            echo "<a href='$outurl'>[注销]</a>";
                        }else{
                             $inurl="/Project_bbs/front/login.php?url={$url}";
                             $regurl="/Project_bbs/front/register.php?url={$url}";
                            echo "<a href='$inurl'>登陆</a><a href='$regurl'>注册</a>";
                        }
                        
                        ?>
                        
                    </div> 
                </div>
            </div>